<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>栏目管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" type="text/css" href="__ADMIN__/layui/css/layui.css" media="all">
  <link rel="stylesheet" type="text/css" href="__ADMIN__/bootstrap/css/bootstrap.css" media="all">
  <link rel="stylesheet" type="text/css" href="__ADMIN__/global.css" media="all">
  <link rel="stylesheet" type="text/css" href="__ADMIN__/css/personal.css" media="all">
  <script type="text/javascript" src="__ADMIN__/jedate/jquery-1.7.2.js"></script>
</head>
<body>
  <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    <ul class="layui-tab-title">
      <li class="{$layui_this}">栏目列表</li>
      <li class="{$his}">添加栏目</li>
      <li class="{$hs}">添加单页</li>
    </ul>
    <div class="layui-tab-content">
      <div class="layui-tab-item {$layui_show}">
        <form class="layui-form" action="/admin/category/listorder" method="post">
        <!-- 栏目列表 -->
        <table class="layui-table">
          <colgroup>
            <col width="100">
            <col>
          </colgroup>
          <thead>
            <tr align="center">
              <th>排序</th>
              <th>栏目ID</th>
              <th>栏目名称</th>
              <th>栏目类型</th>
              <th>所属模型</th>
              <th>分页显示</th>
              <th>访问</th>
              <th>管理操作</th>
            </tr>
          </thead>
          <tbody>
            <volist name="category" id="list">
            <tr>
             <td>
                <div class="layui-input-inline">
                    <input name="listorders[{$list['cateid']}]" required lay-verify="required" autocomplete="off" class="layui-input" type="text" value="{$list['sort']}">
                </div>
              </td>
              <td>{$list['cateid']}</td>
              <td>{$list['catename']}</td>
              <td>
                <if condition="$list['cate_type'] eq 1" >
                  <if condition="$list['is_final'] eq 1" ><span style="color:red;">栏目(终极)</sapn><else />栏目</if>
                  <else />
                  <if condition="$list['is_final'] eq 1" ><span style="color:red;">单页(终极)</sapn><else />单页</if>
                  </if>
              </td>
              <volist name="model" id="mo">
                <if condition="$mo['modelid'] eq $list['modelid']" > 
                 <td >{$mo['name']}</td>
                </if>
              </volist>
              <td>{$list['pagesize']} (条数据)</td>
              <td><a href="__ROOT__/home/list/index?pathname={$list['pathname']}&cateid={$list['cateid']}" target="_blank">访问</a></td>
              <td>
                <a href="/admin/category/col_add/id/{$list['cateid']}" class="layui-btn layui-btn-small layui-btn-danger">添加子栏目</a>
                <a href="/admin/category/edit/id/{$list['cateid']}" class="layui-btn layui-btn-small">编辑</a>
                <a href="/admin/category/del/id/{$list['cateid']}" class="layui-btn layui-btn-small layui-btn-danger">删除</a>
                <if condition="$list['cate_type'] eq 1" >
                <a href="/admin/category/categoryshux/id/{$list['cateid']}" class="layui-btn layui-btn-normal">终极属性转换</a></if>
              </td>
            </tr>
            </volist>
          </tbody>
        </table>
         <div class="layui-input-inline">
            <button class="layui-btn" lay-submit>排序</button>
         </div>
       </form>
      </div>
      <div class="layui-tab-item {$show}">
        <form id="form_add" class="layui-form" action="/admin/category/add" method="post">
        <!-- 添加栏目 -->
        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title">
              <li class="layui-this">基本设置</li>
              <li>SEO配置</li>
              <li id="cof">模板配置</li>
            </ul>
            <div class="layui-tab-content">
              <div class="layui-tab-item layui-show">
                <!-- 基本设置 -->
                 <table class="layui-table">
                    <colgroup>
                      <col width="200">
                      <col>
                    </colgroup>
                    <tbody>
                      <tr>
                        <td><label>请选择模型</label></td>
                        <td>
                          <div class="layui-input-inline">
                             <select lay-filter="test" name="modelid">
                               <volist name="model" id="vo">
                               <option value="{$vo.modelid}" >{$vo.name}</option>
                               </volist>
                             </select>
                         </div>
                        </td>
                      </tr>
                       <tr>
                        <td><label>上级栏目</label></td>
                        <td>
                          <div class="layui-input-inline">
                             <select lay-filter="test" name="parentid">
                               <option value="0">作为一级栏目</option>
                               <volist name="category" id="vo">
                               <option value="{$vo.cateid}" >{$vo.catename}</option>
                               </volist>
                             </select>
                         </div>
                        </td>
                      </tr>
                      <tr id="no">
                        <td><label>添加方式</label></td>
                        <td>
                          <div class="layui-input-inline">
                            <span id="normal"><input name="type" value="1" checked="" title="单条添加" type="radio"></span>
                            <span id="batch"><input name="type" value="2" title="批量添加"  type="radio"></span>
                          </div>
                        </td>
                      </tr>
                       <tr>
                        <td>
                          <font color="red">*</font>
                          <label>栏目名称</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input id="normal_add" name="catename" placeholder="指定栏目名称"  autocomplete="off" class="layui-input" type="text">
                              <br>
                              <textarea id="batch_add" name="c_name" placeholder="请输入内容,用英文,分割。例如：文章,下载" class="layui-textarea" style="display:none"></textarea>
                            </div>
                          </div>
                        </td>
                      </tr>
                      <tr id="path">
                        <td>
                          <font color="red">*</font>
                          <label>目录名</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input id="path_add" name="pathname" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                       <tr>
                        <td>
                          <label>栏目描述</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input name="description" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td><label>是否在导航显示</label></td>
                        <td>
                          <div class="layui-input-inline">
                            <input name="is_nav" value="1" title="是" checked="" type="radio">
                            <input name="is_nav" value="0" title="否"  type="radio">
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td><label>是否为终极栏目 </label><br>
                            <font color="red" size="2">终极栏目才可以 编辑/修改 信息</font></td>
                        <td>
                          <div class="layui-input-inline">
                            <input name="is_final" value="1" title="是" type="radio">
                            <input name="is_final" value="0" title="否" checked="" type="radio">
                          </div>
                        </td>
                      </tr>
                       <tr>
                        <td><label>是否外部链接</label></td>
                        <td>
                          <div class="layui-input-inline">
                            <span id="is_url"><input name="is_outer" value="1" title="是" type="radio"></span>
                            <span id="no_url"><input name="is_outer" value="0" title="否" checked="" type="radio"></span>
                          </div>
                        </td>
                      </tr>
                      <tr id="cate_url" style="display:none">
                        <td>
                           <label>指定栏目地址(外部)</label>
                           <br>
                           <font color="red" size="2">指定地址后，栏目的url就变成此项的值</font>
                        </td>
                        <td>

                          <div class="layui-input-inline" style="width: 250px;">
                              <input name="cate_url" placeholder="指定栏目地址" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>
                          <label>分页显示</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input name="pagesize" value="10" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>
                          <label>排序</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input name="sort" value="0" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                    </tbody>
                  </table> 
                  <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                  </div>
              </div>
              <div class="layui-tab-item">
                <!-- SEO配置 -->
                <table class="layui-table">
                  <colgroup>
                    <col width="180">
                    <col>
                  </colgroup>
                  <tbody>
                    <tr>
                      <td>
                        <label>SEO栏目标题</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="seo_title" placeholder="针对搜索引擎设置的标题" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>SEO栏目关键字</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="seo_keywords" placeholder="针对搜索引擎设置的关键字" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>SEO栏目描述</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="seo_description" placeholder="针对搜索引擎设置的栏目描述" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>手机版SEO栏目标题</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="m_seo_title" placeholder="针对手机版搜索引擎设置的栏目标题" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>手机版SEO栏目关键字</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="m_seo_keywords" placeholder="针对手机版搜索引擎设置的栏目关键字" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>手机版SEO栏目描述</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="m_seo_description" placeholder="针对手机版搜索引擎设置的栏目描述" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                  </tbody>
                </table>
                <div class="layui-input-block">
                  <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                </div>
              </div>
              <div class="layui-tab-item" id="see_height">
                <!-- 模板配置 -->
                <table class="layui-table">
                  <colgroup>
                    <col width="150">
                    <col>
                  </colgroup>
                  <tbody>
                     <tr>
                      <td><label>栏目模板</label></td>
                      <td>
                        <div class="layui-input-inline" style="width:500px;">
                           <select lay-filter="test" name="category_template">
                              <if condition="$index_tpl">
                              <volist name="index_tpl" id="list">
                              <option>{$list}</option>
                              </volist>
                              <else />
                              <option value="">请选择</option>
                              </if>
                           </select>
                       </div>
                      </td>
                    </tr>
                    <tr>
                      <td><label>列表模板</label></td>
                      <td>
                        <div class="layui-input-inline" style="width:500px;">
                           <select lay-filter="test" name="list_template">
                              <if condition="$list_tpl">
                              <volist name="list_tpl" id="list">
                              <option>{$list}</option>
                              </volist>
                              <else />
                              <option value="">请选择</option>
                              </if>
                           </select>
                       </div>
                      </td>
                    </tr>
                     <tr>
                      <td><label>内容模板</label></td>
                      <td>
                        <div class="layui-input-inline" style="width:500px;">
                           <select lay-filter="test" name="show_template">
                              <if condition="$show_tpl">
                              <volist name="show_tpl" id="list">
                              <option>{$list}</option>
                              </volist>
                              <else />
                              <option value="">请选择</option>
                              </if>
                           </select>
                       </div>
                      </td>
                    </tr>
                  </tbody>
                </table>
                <br>
                <div class="layui-input-block">
                  <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                </div>
              </div>
            </div>
        </div>
      </form>
      </div>
      <div class="layui-tab-item {$how}" >
        <form id="single_add" class="layui-form" action="/admin/category/single" method="post">
        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title">
              <li class="layui-this">基本设置</li>
              <li>SEO配置</li>
              <li id="fog">模板配置</li>
            </ul>
            <div class="layui-tab-content">
              <div class="layui-tab-item layui-show">
                <!-- 基本设置 -->
                 <table class="layui-table">
                    <colgroup>
                      <col width="200">
                      <col>
                    </colgroup>
                    <tbody>
                      
                       <tr>
                        <td><label>上级栏目</label></td>
                        <td>
                          <div class="layui-input-inline">
                             <select lay-filter="test" name="parentid">
                               <option value="0">作为一级栏目</option>
                               <volist name="category" id="vo">
                               <option value="{$vo.cateid}" >{$vo.catename}</option>
                               </volist>
                             </select>
                         </div>
                        </td>
                      </tr>
                       <tr name="normal_add">
                        <td>
                           <font color="red">*</font>
                          <label>栏目名称</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input name="catename" required lay-verify="required" autocomplete="off" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>
                          <font color="red">*</font>
                          <label>目录名</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input id="single_name" name="pathname" required lay-verify="required" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                       <tr>
                        <td>
                          <label>栏目描述</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input name="description" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td><label>是否在导航显示</label></td>
                        <td>
                          <div class="layui-input-inline">
                            <input name="is_nav" value="1" title="是" type="radio">
                            <input name="is_nav" value="0" title="否" checked="" type="radio">
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td><label>是否为终极栏目 </label><br>
                            <font color="red" size="2">终极栏目才可以 编辑/修改 信息</font></td>
                        <td>
                          <div class="layui-input-inline">
                            <input name="is_final" value="1" title="是" type="radio">
                            <input name="is_final" value="0" title="否" checked="" type="radio">
                          </div>
                        </td>
                      </tr>
                       <tr>
                        <td><label>是否外部链接</label></td>
                        <td>
                          <div class="layui-input-inline">
                            <span id="is_ur"><input name="is_outer" value="1" title="是" type="radio"></span>
                            <span id="no_ur"><input name="is_outer" value="0" title="否" checked="" type="radio"></span>
                          </div>
                        </td>
                      </tr>
                      <tr id="cate_ur" style="display:none">
                        <td>
                           <label>指定栏目地址(外部)</label>
                           <br>
                           <font color="red" size="2">指定地址后，栏目的url就变成此项的值</font>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input name="cate_url" placeholder="指定栏目地址" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>
                          <label>分页显示</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input name="pagesize" value="10" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>
                          <label>排序</label>
                        </td>
                        <td>
                          <div class="layui-input-inline" style="width: 250px;">
                              <input name="sort" value="0" autocomplete="off" class="layui-input" type="text">
                          </div>
                        </td>
                      </tr>
                    </tbody>
                  </table> 
                  <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                  </div>
              </div>
              <div class="layui-tab-item">
                <!-- SEO配置 -->
                <table class="layui-table">
                  <colgroup>
                    <col width="180">
                    <col>
                  </colgroup>
                  <tbody>
                    <tr>
                      <td>
                        <label>SEO栏目标题</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="seo_title" placeholder="针对搜索引擎设置的标题" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>SEO栏目关键字</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="seo_keywords" placeholder="针对搜索引擎设置的关键字" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>SEO栏目描述</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="seo_description" placeholder="针对搜索引擎设置的栏目描述" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>手机版SEO栏目标题</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="m_seo_title" placeholder="针对手机版搜索引擎设置的栏目标题" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>手机版SEO栏目关键字</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="m_seo_keywords" placeholder="针对手机版搜索引擎设置的栏目关键字" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <label>手机版SEO栏目描述</label>
                      </td>
                      <td>
                        <div class="layui-input-inline" style="width: 250px;">
                            <input name="m_seo_description" placeholder="针对手机版搜索引擎设置的栏目描述" autocomplete="off" class="layui-input" type="text">
                        </div>
                      </td>
                    </tr>
                  </tbody>
                </table>
                <div class="layui-input-block">
                  <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                </div>
              </div>
              <div class="layui-tab-item" id="dee_height">
                <!-- 模板配置 -->
                <table class="layui-table">
                  <colgroup>
                    <col width="150">
                    <col>
                  </colgroup>
                  <tbody>
                     <tr>
                      <td><label>内容模板</label></td>
                      <td>
                        <div class="layui-input-inline" style="width:500px;">
                           <select lay-filter="test" name="show_template">
                              <if condition="$page_tpl">
                              <volist name="page_tpl" id="list">
                              <option>{$list}</option>
                              </volist>
                              <else />
                              <option value="">请选择</option>
                              </if>
                           </select>
                       </div>
                      </td>
                    </tr>
                  </tbody>
                </table>
                <br>
                <div class="layui-input-block">
                  <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                </div>
              </div>  
            </div>
        </div>
      </form>
      </div>
    </div>
  </div> 
<script src="__ADMIN__/layui/layui.js" charset="utf-8"></script>
<script>
layui.use('element', function(){
  var $ = layui.jquery
  ,element = layui.element(); //Tab的切换功能，切换事件监听等，需要依赖element模块
});
layui.use('form', function(){
  var form = layui.form();
  });
</script>
<script type="text/javascript">
//单条添加绑定
$("#normal").click(function(){
  s=("#normal_add");
  $("#batch_add").css("display","none");
  $("#normal_add").css("display","block");
  $("#path").css("display","");
});

//批量添加绑定
$("#batch").click(function(){
   $("#batch_add").css("display","block");
   $("#normal_add").css("display","none");
   $("#path").css("display","none");
});

//外部链接显示 栏目
$("#is_url").click(function(){
   $("#cate_url").css("display","");
});
$("#no_url").click(function(){
   $("#cate_url").css("display","none");
});

//外部链接显示 单页
$("#is_ur").click(function(){
   $("#cate_ur").css("display","");
});
$("#no_ur").click(function(){
   $("#cate_ur").css("display","none");
});

$("#cof").click(function(){
  a=$(window).height();
  $("#see_height").css("height",a);
});
$("#fog").click(function(){
  a=$(window).height();
  $("#dee_height").css("height",a);
});

</script>
</body>
</html>